package bupt.xixi.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class Codec {

    public static final int MAGIC_NUMBER = 0xECECECEC;
    public static final Integer IDLE = 60;

    @AllArgsConstructor
    @Getter
    public enum PackageType {
        /**
         * 包类型
         */
        REQUEST_PACK(0, "请求"),
        RESPONSE_PACK(1, "回复"),
        HEART_PACK(2, "心跳");

        private final int code;
        private final String info;
    }

    @AllArgsConstructor
    @Getter
    public enum SerializeType {

        /**
         * 暂时只会这一个呜呜呜
         */
        KYRO(0, "Kyro");

        private final int code;
        private final String info;
    }

    @AllArgsConstructor
    @Getter
    public enum heartData {
        /**
         * 心跳数据
         */
        PING((byte) 0x01, 1, "ping"),
        PONG((byte) 0x02, 1, "pong");

        private final byte code;
        private final int length;
        private final String data;
    }

}
